<template>
  <div id="httpdemo">
      <div slot="header" class="clearfix">
          <h1 style="line-height: 36px; color: #20A0FF">豆瓣电影排行榜</h1>
      </div>
      <div v-for="article in articles" class="text item" :key="article.id">
        {{article.title}}
      </div>
  </div>
</template>
<script type="text/javascript">

export default {
  name: 'HttpDemo',
  data () {
    return {
      articles: []
    }
  },
  mounted: function () {
    this.$http.jsonp('https://api.douban.com/v2/movie/top250?count=10', {}, {
      headers: {
      },
      emulateJSON: true
    }).then(function (response) {
      this.articles = response.data.subjects
    }, function (response) {
      console.log(response)
    })
  }
}
</script>
